/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package myBeans;

/**
 *
 * @author Phu
 */
public class Item {
    private String bookID;
    private int quantity;
    private float price;
    public float getPrice() {
        return price;
    }
    public Item(String bookID, int quantity, float price) {
        super();
        this.bookID = bookID;
        this.quantity = quantity;
        this.price = price;
    }
    public String getBookID() {
        return bookID;
    }
    public void setBookID(String bookID) {
        this.bookID = bookID;
    }
    public int getQuantity() {
        return quantity;
    }
    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((bookID == null) ? 0 : bookID.hashCode());
        return result;
    }
    public void setPrice(float price) {
        this.price = price;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Item other = (Item) obj;
        if (bookID == null) {
            if (other.bookID != null)
                return false;
        } else if (!bookID.equalsIgnoreCase(other.bookID))
            return false;
        return true;
    }
     
    @Override
    public String toString() {
        return bookID;
    }
}
